<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>八维贷</title>
    <script src="https://unpkg.com/vue/dist/vue.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
</head>
<body>

<div id="app">
    <center>
        <hr>
        <div align="right">
            欢迎{{mobile}},<a @click="logout">退出</a>
        </div>
        <hr>
        <img src="logo.png" width="60%">
        <hr>

        <h3>充值</h3>
        <form method="post" action="http://localhost:8001/bha-neo-app/lanmaotech/gateway">
            <input name="serviceName"  v-model="reqData.serviceName">
            <input name="platformNo"  v-model="reqData.platformNo">
            <input name="userDevice"  v-model="reqData.userDevice">
            <input name="reqData"  v-model="reqData.reqData">
            <input name="keySerial"  v-model="reqData.keySerial">
            <input name="sign"  v-model="reqData.sign"><br>
            <!--从这里把需要的参数准备好了，通过这个进入银行的接口-->
            <el-button type="primary" @click="toRecharge">充值</el-button>
        </form>


        <div style="width: 100%;position: absolute;bottom: 0">
            <hr>
            www.bwyjs.com @
            云计算1810A
            <hr>
        </div>
    </center>
</div>
<script>
    new Vue({
        el:'#app',
        data() {
            return {
                mobile:'',
                reqData:{
                    serviceName:'',
                    platformNo:'',
                    userDevice:'',
                    reqData:'',
                    keySerial:'',
                    sign:''
                }
            };
        },
        methods: {
            logout(){
                localStorage.removeItem("mobile")
                location.href="index.html"
            },
            toRecharge(){
                document.forms[0].submit();
            }
        },
        created(){
            this.mobile = localStorage.getItem("mobile");
            if(this.mobile==undefined){
                location.href="index.html"
            }

            axios.post("/initRechargeParam/"+this.mobile).then((res)=>{
                this.reqData = res.data;
            });
        }
    })
</script>
</body>
</html>